<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Quiz
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: view.tpl 2010-07-02 17:53 ermek $
 * @author     Ermek
 */
?>

<br/>
<script type="text/javascript">
en4.core.runonce.add(function()
{
  $('inviter_password_box').value = 'password...';
  var $subscriber_input = $$('.inviter_fields'); 
  
  $subscriber_input.addEvents({
      'focus':function(){
        if ($(this).value.trim() == 'email...' || $(this).value.trim() == 'password...' || $(this).value.trim() == 'provider...')
        {
          $(this).setProperty('value', '');
          $(this).setStyle('color', '#000000');         
        }
      },
      'blur':function(){
        if ($(this).value.trim() == '')
        {
            $(this).setStyle('color', '#999999');
            if ($(this).getProperty('id') == 'inviter_email_box')
            {
              $(this).setProperty('value', 'email...');
            }
            else
            if ( $(this).getProperty('id') == 'inviter_password_box')
            {
              $(this).setProperty('value', 'password...');
            }
            if ( $(this).getProperty('id') == 'provider_box')
            {
              $(this).setProperty('value', 'provider...');
            }
        }
     	}
   });

  if ($('inviter-writer-form') != undefined)
  {
  	$('inviter-writer-form').slide('hide').slide('out');
  }
});

function tab_slider($tab)
{
	$$('.inviter-form-cont').removeClass('inviter-form-bg');
	$$('.inviter-form-cont').removeClass('inviter-form-hover');
	$$('.inviter-form').slide('hide').slide('out');
	$$('.inviter-tab-title').addClass('inviter-form-title');

	$('inviter-'+$tab+'-form').slide('hide').slide('in');
	$('inviter-'+$tab+'-title').removeClass('inviter-form-title');
	$('inviter-'+$tab+'-conteiner').addClass('inviter-form-bg');
}

function show_creation_description(id)
{
	if ($(id).hasClass('creation_item_hide')){
		$(id).removeClass('creation_item_hide');
	} else {
		$(id).addClass('creation_item_hide');
	}
}

</script>


<script type="text/javascript">
  en4.core.runonce.add(function() {
    provider.set_enabled('Facebook', <?php echo ($this->facebookKey) ? 1 : 0 ?>);
    provider.set_enabled('Twitter', <?php echo ($this->twitterKey) ? 1 : 0 ?>);
    provider.set_enabled('LinkedIn', <?php echo ($this->linkedinKey) ? 1 : 0 ?>);
    provider.set_enabled('GMail', <?php echo ($this->gmailKey) ? 1 : 0 ?>);

    provider.oauth_url = "<?php echo $this->url(array('module' => 'inviter', 'controller' => 'oauth', 'action' => 'request', 'format' => 'smoothbox'), 'default') ?>";
  });
</script>

<div class='inviter-forms-conteiner global_form'>
	<div>
			<div>
				<div class='inviter-form-cont inviter-form-bg' id='inviter-importer-conteiner'>
						<div id='inviter-importer-title' class="inviter-tab-title inviter-import-title"
							onclick="if ($(this).hasClass('inviter-form-title')){tab_slider('importer');}"
							onmouseover="if ($(this).hasClass('inviter-form-title')){$('inviter-importer-conteiner').addClass('inviter-form-hover')}"
							onmouseout="if ($(this).hasClass('inviter-form-title')){$('inviter-importer-conteiner').removeClass('inviter-form-hover')}">
							<h3 style="padding: 8px;"><?php echo $this->translate('INVITER_Import Your Contacts')?></h3>
						</div>
						<div class='inviter-form' id='inviter-importer-form' > <?php echo $this->form->render($this)?> </div>
				</div>

				<?php  if ($this->viewer->getIdentity()):?>
				<div class='inviter-form-conteiner inviter-form-cont' id='inviter-writer-conteiner'>
					<div id='inviter-writer-title' class='inviter-tab-title inviter-write-title inviter-form-title'
							onclick="if ($(this).hasClass('inviter-form-title')){tab_slider('writer');}"
							onmouseover="if ($(this).hasClass('inviter-form-title')){$('inviter-writer-conteiner').addClass('inviter-form-hover')}"
							onmouseout="if ($(this).hasClass('inviter-form-title')){$('inviter-writer-conteiner').removeClass('inviter-form-hover')}">
							<h3 style="padding: 8px;"><?php echo $this->translate('INVITER_Write Your Contacts')?></h3>
						</div>
					<div class='inviter-form' id='inviter-writer-form'> <?php echo $this->form_write->render($this)?> </div>
				</div>
				<?php endif; ?>
			</div>
		</div>
</div>
<div id='default_provider_list' style='display:none;'></div>
<br/>